<div class="users form">
    <h2><?php __('Add Article'); ?></h2>
    <?php echo $form->create('Article',array('type'=>'file'));?>
    <fieldset>
    	 <div class="tabs">
                <ul>
                    <li><a href="#article-main"><span><?php __('Article'); ?></span></a></li>
                    <li><a href="#article-seo"><span><?php __('seo'); ?></span></a></li>
                    <li><a href="#article-access"><span><?php __('Access'); ?></span></a></li>
                    <li><a href="#article-publishing"><span><?php __('Publishing'); ?></span></a></li>
                </ul>
                <div id="article-main" class="innertabs">
                	 <?php
                		echo $form->input('id');
				         echo $form->input('title',array('div'=>'wide'));
				         echo $form->input('subtitle',array('div'=>'wide'));
				         echo $form->input('CategoryData.category_id',array('type'=> 'select','selected'=> $cate_id,'options' => $categorys));
				         echo $form->input('slug');
				        echo $form->input('authorname');
				        echo $form->input('origin');
				       // echo $form->input('photo',array('type'=>'file'));
				        ?>
							<div class="swfupload-control" >	
								<div class="fieldset flash" id="fsUploadProgress" style="display:none;">
									<span class="legend">Upload Queue</span>
									<!-- This is where the file progress gets shown.  SWFUpload doesn't update the UI directly.
												The Handlers (in handlers.js) process the upload events and make the UI updates -->
									<div id="hidFileID" ></div>
								</div>
								
								<span id="spanButtonPlaceholder"></span>(10MB max)
							</div>

				        <?PHP
				        echo $form->input('keywords');
				        echo $form->input('content',array('div'=>'wide'));
				        ?>
				        
                </div>
                
                 <div id="article-seo"  class="innertabs">
	                 	<?php
		       
					        echo $form->input('seotitle',array('rows' => '2', 'cols' => '50','div'=>'wide')); 
					        echo $form->input('seodescription',array('rows' => '5', 'cols' => '50','div'=>'wide'));
					        echo $form->input('seokeywords',array('rows' => '5', 'cols' => '50','div'=>'wide'));
					    	?>
                 </div>               
                 <div id="article-access"  class="innertabs">
                 	 <?php
                        echo $form->input('Role.Role');
                    ?>
                 </div>
                 <div id="article-publishing"  class="innertabs">
                 	<?php
                    echo $form->input('status', array('label' => __('Published', true)));
                    echo $form->input('promote', array('label' => __('Promoted to front page', true)));
                    echo $form->input('user_id');
                    echo $form->input('created',array('div'=>'wide'));
                	?>
                 </div>                 	
       </div>
                
	    
    </fieldset>
    <?php echo $form->end(array('label'=>'Submit','id'=>'btnsubmit')); ?>
   
</div>
<?php echo $ckeditor->load('ArticleContent'); ?>
<script>
var swfu;
$(function () {
			swfu = new SWFUpload({
				upload_url: "/uploads/upload",
				file_post_name: "Filedata",
				file_size_limit : "10 MB",
				file_types : "*.*",
				file_types_description : "All Files",
				file_upload_limit : 0,
				file_queue_limit : 0,

				button_image_url : "/img/XPButtonUploadText_61x22.png",
				button_placeholder_id : "spanButtonPlaceholder",
				button_width: 61,
				button_height: 22,
				
				flash_url : "/js/swfupload/swfupload.swf",
				flash9_url : "/js/swfupload/swfupload_fp9.swf",
				
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				
				swfupload_preload_handler : preLoad,
				swfupload_load_failed_handler : loadFailed,
				swfupload_loaded_handler : loadSuccess,
				
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				custom_settings : {
					progress_target : "fsUploadProgress",
					upload_successful : false
				},
				debug: true
			});

		});
</script>
<script>
	$(document).ready(function(){
		$('#btnsubmit').click(function(){
			uploadDone() ;return false;	
			try {
				if(swfu.getStats().files_queued ==0)
				{
					uploadDone() ;
				}
				else
				{
					swfu.startUpload();
				}
			} catch (ex) {
		
			}
			return false;	
		});
	});
</script>
